package middlewera

import (
	"fmt"
	"github.com/gin-gonic/gin"
	"www.bwbdim.com/pkg"
)

func LoginMiddleware(c *gin.Context) {
	tokenString := c.GetHeader("token")
	fmt.Println(tokenString)

	userId := pkg.NewJwt().TokenDecode(tokenString)

	c.Set("user_id", userId)
	c.Next()

}
